package com.baomidou.springwind.test.Stack;

import java.util.Arrays;
import java.util.Iterator;
import java.util.Stack;
/**
 * Created by Administrator on 2017-01-13.
 */
public class StackWork {
    private static String strings = "+U+n+c---+e+r+t---+a-+i-+n+t+y---+ -+r+u--+l+e+s---";

    public StackWork() {

    }
//
//    public void work(Iterator<String> iterator) {
//        while (iterator.hasNext()) {
//            if (iterator.next().equals("+")) {
//                iterator.remove();
//                stringStack.push(iterator.next());
//            } else if (iterator.next().equals("-")) {
//                iterator.remove();
//                System.out.println(stringStack.pop());
//            }
//        }
//    }

    public static void main(String[] args) {
/*        Stack<Character> stringStack = new Stack<Character>();
        Iterator<String> string = Arrays.asList(strings).iterator();
        char[] chars = strings.toCharArray();
        for (int i = 0; i < chars.length;i++) {
            switch (chars[i]) {
                case '+':
                    stringStack.push(chars[++i]);
                    break;
                case '-':
                    System.out.print(stringStack.pop());
            }
        }*/
//        StackWork stackWork = new StackWork();
//        stackWork.work(string);

    }
}
